package com.dao;

import com.model.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * Created by admin on 2017/3/2.
 */
@Repository
public class LoginLogDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void insertLoginLog(Users users) {
        Object[] args = {users.getUser_id(), users.getLast_ip(), new Date()};
        String sql = "INSERT INTO t_login_log( user_id, ip, login_datetime)VALUES(?,?,?)";
        jdbcTemplate.update(sql, args);
    }

}
